package com.zx.cloud.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zx.cloud.ApiVersion;
import com.zx.cloud.controller.client.ClientInfoClient;
import com.zx.cloud.domain.ClientContact;
import com.zx.cloud.domain.ClientInfo;
import com.zx.cloud.domain.Proposal;
import com.zx.cloud.model.response.ObjectDataResponse;
import com.zx.cloud.model.response.Response;
import com.zx.cloud.util.Page;

import io.swagger.annotations.ApiOperation;

/**
 * @Description:
 *
 * @author       Yan Weiwei
 * @Create Time: 2017年11月1日下午1:44:39
 */

@RestController
@RequestMapping(value = ApiVersion.MANAGER_V1_PREFIX + "/clientInfo")
public class ClientInfoController {

	@Autowired
	private ClientInfoClient clientInfoClient;
	
	@ApiOperation(value = "查询会员列表信息" , notes = "查询会员列表信息")
	@RequestMapping(value = "/queryClientInfo", method = RequestMethod.POST)
	@ResponseBody
	public Response queryClientInfo(@RequestBody ClientInfo clientInfo){
		
		ObjectDataResponse<Page<Object>>  loginRequestObj = clientInfoClient.queryClientInfo(clientInfo);
		
		return loginRequestObj;
	}
	
	@ApiOperation(value = "查询会员个人信息" , notes = "查询会员个人信息")
	@RequestMapping(value = "/queryClientInfoById", method = RequestMethod.POST)
	@ResponseBody
	public Response queryClientInfoById(@RequestBody String tableId){
		
		ObjectDataResponse<ClientInfo>  loginRequestObj = clientInfoClient.queryClientInfoById(tableId);
		
		return loginRequestObj;
	}
	
	@ApiOperation(value = "查询会员通讯录信息" , notes = "查询会员通讯录信息")
	@RequestMapping(value = "/queryClientContact", method = RequestMethod.POST)
	@ResponseBody
	public Response queryClientContact(@RequestBody String tableId){
		
		ObjectDataResponse<List<ClientContact>>  loginRequestObj = clientInfoClient.queryClientContact(tableId);
		
		return loginRequestObj;
	}
	
	@ApiOperation(value = "查询会员认证列表信息" , notes = "查询会员认证列表信息")
	@RequestMapping(value = "/queryClientAuth", method = RequestMethod.POST)
	@ResponseBody
	public Response queryClientAuth(@RequestBody ClientInfo clientInfo){
		
		ObjectDataResponse<Page<ClientInfo>>  loginRequestObj = clientInfoClient.queryClientAuth(clientInfo);
		
		return loginRequestObj;
	}
	
	@ApiOperation(value = "修改会员详细信息" , notes = "修改会员详细信息")
	@RequestMapping(value = "/updateClientInfo", method = RequestMethod.POST)
	@ResponseBody
	public Response updateClientInfo(@RequestBody ClientInfo clientInfo){
		
		ObjectDataResponse<Integer>  loginRequestObj = clientInfoClient.updateClientInfo(clientInfo);
		
		return loginRequestObj;
	}
	
	@ApiOperation(value = "添加会员详细信息" , notes = "添加会员详细信息")
	@RequestMapping(value = "/addClientInfo", method = RequestMethod.POST)
	@ResponseBody
	public Response addClientInfo(@RequestBody ClientInfo clientInfo){
		
		ObjectDataResponse<Integer>  loginRequestObj = clientInfoClient.addClientInfo(clientInfo);
		
		return loginRequestObj;
	}
	
	
	@ApiOperation(value = "查询意见反馈信息" , notes = "查询意见反馈信息")
	@RequestMapping(value = "queryProposal", method = RequestMethod.POST)
	@ResponseBody
	public Response queryProposal(@RequestBody Proposal proposal){
		ObjectDataResponse<Page<Proposal>> ProposalPage= clientInfoClient.queryProposal(proposal);
		return ProposalPage;
	}
	
	@ApiOperation(value = "修改意见反馈信息" , notes = "修改意见反馈信息")
	@RequestMapping(value = "updateProposal", method = RequestMethod.POST)
	@ResponseBody
	public Response updateProposal(@RequestBody Proposal proposal){
		ObjectDataResponse<Integer> loginRequestObj = clientInfoClient.updateProposal(proposal);
		return loginRequestObj;
	}
	
}
